<template>
  <van-popup v-model="show" round :duration='duration' position="center">
    <div class="content-verify">
      <div class="title">{{ title }}</div>
      <div class="list">
        <div class="item" :class="t.class" v-for='(t,i) in list' :key='i' @click='clickItem(t)'>
          <img class="img" :src="t.img">
          <p>{{ t.label }}</p>
        </div>
      </div>
    </div>
  </van-popup>
</template>

<script>
export default {

  data() {
    return {
      title: '请选择类型',
      duration: 0,
      list: [
        {
          label: '身份证',
          value: 'idcard',
          img: require('@/assets/images/verify-type/id-card.png'),
          class: 'green',
        },
        {
          label: '刷脸',
          value: 'face',
          img: require('@/assets/images/verify-type/face.png'),
          class: 'blue',
        },
      ],
      show: false,
    }
  },
  computed: {},
  mounted() {
  },
  methods: {
    //打开弹窗
    open() {
      this.show = true;
    },
    clickItem(t) {
      this.$emit('change', t)
      this.show = false;
    },
    //返回
    goBack() {
      this.show = false;
    },
  }
}
</script>

<style lang="less" scoped>
.content-verify {
  padding: 40px;
  width: 300px;

  .title {
    text-align: center;
    font-size: 30px;
    margin-bottom: 20px;
  }

  .list {
    display: flex;
    flex-direction: column;

    .item {
      width: 100%;
      border: 14px solid #fff;
      border-radius: 26px;
      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
      padding: 15px;
      display: flex;
      margin-left: 20px;
      color: #000;
      justify-content: center;

      &.blue {
        background: linear-gradient(180.00deg, rgba(89, 163, 250, 1.00) 12.476%, rgba(34, 111, 255, 1.00) 100%);
        border-color: rgb(167, 211, 255);
      }

      &.green {
        background: linear-gradient(180.00deg, rgba(44, 216, 120, 1.00) 12.476%, rgba(56, 176, 34, 1.00) 100%);
        border-color: rgb(163, 249, 200);
      }


      .img {
        width: 20px !important;
        flex: 20px;
        height: 20px;
        margin-left: 20px;
      }

      p {
        font-size: 40px;
        line-height: 95px;
        color: #fff;
      }
    }
  }

}
</style>